<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>文字填充动画</title>
		<style type="text/css">
			* {
  box-sizing: border-box;
}

html {
  font-size: 8px;
}

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background-color:#fff;
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  font-weight: 700;
  text-transform: lowercase;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
      -ms-flex-pack: center;
          justify-content: center;
}

.loader {
  position: relative;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  cursor: pointer;
}
.loader:hover .loader__mask {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}
.loader:hover .loader__mask .loader__text--progress {
  -webkit-transform: translateX(0);
          transform: translateX(0);
}

.loader__mask {
  position: absolute;
  overflow: hidden;
  -webkit-transform: translateX(-100%);
          transform: translateX(-100%);
  -webkit-transition: -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1), -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}

.loader__text--preload {
  color: rgba(22, 22, 22, 0.1);
}

.loader__text--progress {
  color: #161616;
  -webkit-transform: translateX(100%);
          transform: translateX(100%);
  -webkit-transition: -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1);
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1), -webkit-transform 1s cubic-bezier(0.77, 0, 0.175, 1);
}

		</style>
	</head>
	<body>
		<div class="loader">
	<div class="loader__mask">
		<div class="loader__text loader__text--progress">hover me</div>
	</div>
	<div class="loader__text loader__text--preload">hover me</div>
</div>
	</body>
</html>
